package com.voyage.voyagemall.product.exception;


import com.voyage.voyagemall.common.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice(basePackages = "com.voyage.voyagemall.product.controller")
@Slf4j
public class VoyagemallExceptionControllerAdvice {


    @ExceptionHandler(value = Exception.class)
    public R handlerException(Exception e) {
        log.error("数据出现异常,异常类型：", e.getMessage(), e.getClass(), e.getCause());
        return R.error();
    }
}
